
<template>
	<el-config-provider :locale="locale">
		<router-view></router-view>
	</el-config-provider>
</template>
<script>
	import { ElConfigProvider } from 'element-plus'
	import zhCn from 'element-plus/lib/locale/lang/zh-cn'
	
	export default {
	   components: {
		 ElConfigProvider
	   },
	   setup() {
	       return {
	         locale: zhCn
	       }
	     },
	  created() {
	    if (localStorage.getItem('store')) {
	      this.$store.replaceState(Object.assign({}, this.$store.state, 
	      JSON.parse(localStorage.getItem('store'))))
	    }
	    // 监听页面刷新
	    window.addEventListener('beforeunload', () => {
	      localStorage.setItem('store', JSON.stringify(this.$store.state))
	    })
	  },
	}
</script>
<style scoped>
	
	
	
</style>
